<?php

   class template
     {
     var $name;
     var $content;
     var $endung;
     var $variablen = array("test"=>"val");
      public function __construct($name,$endung = "php")
             { // BEGIN function __construct
             	 $this->name = $name;
             	 $this->endung = $endung;
             } // END function __construc
      public function buildsite($array)
        {
         $this->content .= @file_get_contents("templates/".$this->name.".".$this->endung);
         foreach($array as $a=>$b)
           {
              $this->content = str_replace("{".$a."}",$b,$this->content);
           }
        
        }
      public function display()
        {
           echo $this->content;
        }
      public function addc($text)
        {
         $this->content .= $text;
        }
     }
?>
